//
//  SaleTableViewCell.m
//  Car
//
//  Created by lanou on 15/9/18.
//  Copyright (c) 2015年 朱鸿儒. All rights reserved.
//

#import "SaleTableViewCell.h"

@implementation SaleTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self) {
        self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
        self.selectionStyle = 0;
        self.image = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 100, 100)];
        self.image.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:self.image];
        
        self.leavlName = [[UILabel alloc]initWithFrame:CGRectMake(115, 20, kWidth - 110, 30)];
        [self addSubview:self.leavlName];
        
        self.price = [[UILabel alloc]initWithFrame:CGRectMake(115, 50, kWidth - 110, 30)];
        self.price.font = [UIFont systemFontOfSize:13];
        self.price.textColor = [UIColor redColor];
        [self addSubview:self.price];
        
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(10, 109, kWidth - 10, 0.5)];
        line.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:line];

    }
    return self;
}
- (void)setWithModel:(SaleModel *)model{
    if ([Setting shareWithSetting].isOnPic == NO) {
    [self.image sd_setImageWithURL:[NSURL URLWithString:model.imgurl]];
    }
    self.leavlName.text = model.name;
    self.price.text = model.price;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
